//
//  OperatorNode.m
//  DataCollector
//
//  Created by jiro on 12/06/29.
//  Copyright 2012 jiro music. All rights reserved.
//

#import "BinaryOperatorNode.h"

BinaryOperatorNode::BinaryOperatorNode( Type typeArg )
{
	type = typeArg;
}

bool BinaryOperatorNode::isBinary() const
{
	return true;
}

NSString* BinaryOperatorNode::query() const
{
	switch ( type )
	{
	case BinaryOperatorNode::Type_Equal:
		return @" = ";
	case BinaryOperatorNode::Type_Greater:
		return @" > ";
	case BinaryOperatorNode::Type_Less:
		return @" < ";
	case BinaryOperatorNode::Type_GreaterOrEqual:
		return @" >= ";
	case BinaryOperatorNode::Type_LessOrEqual:
		return @" <= ";
	case BinaryOperatorNode::Type_Comma:
		return @" , ";	
	case BinaryOperatorNode::Type_And:
		return @" and ";
	case BinaryOperatorNode::Type_Or:
		return @" or ";
	case BinaryOperatorNode::Type_Plus:
		return @" + ";
	case BinaryOperatorNode::Type_Minus:
		return @" - ";
	case BinaryOperatorNode::Type_Multuple:
		return @" * ";
	case BinaryOperatorNode::Type_Divide:
		return @" / ";
	case BinaryOperatorNode::Type_Like:
		return @" like ";
	}
	return @"";
}
